import request from '@/utils/request'

/**
 * 查询
 * @returns {AxiosPromise}
 */
export function getHomeList() {
  return request({
    url: '/home-img',
    method: 'get'
  })
}

/**
 * 添加
 */
export function addHomeImg(data) {
  return request({
    url: '/home-img',
    method: 'post',
    data
  })
}

/**
 * 修改
 * @param data
 * @returns {AxiosPromise}
 */
export function updateHomeImg(data) {
  return request({
    url: '/home-img',
    method: 'put',
    data
  })
}

/**
 * 删除
 * @param id
 * @returns {AxiosPromise}
 */
export function removeHomeImg(id) {
  return request({
    url: `/home-img/${id}`,
    method: 'delete'
  })
}

export function getProductList() {
  return request({
    url: 'product-info/getAll',
    method: 'get'
  })
}
